<template>
	<view class="list">
		<view class="title">订单列表</view>
		<view class="orderItem" v-for="(item,index) in orderList" :key="index">
			<view class="title-container">
				<view class="orderNum">订单号：<text>{{item.order_number}}</text></view>
				<view class="orderTime"> <text>{{item.create_time}}</text> </view>
			</view>
			<view class="Item-container" v-for="(item2,index2) in item.goods" :key="index2">
				<view class="top">
					<view class="orderImage">
						<image :src="item2.url"></image>
					</view>
					<view class="orderDetail">
						<view class="left">
							{{item2.name}}
						</view>
						<view class="right">
							<view>￥{{item2.goods_price}}</view>
							<view style="color: #828282;">×{{item2.goods_number}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="price">
				应付：￥<text>{{item.order_price}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		data() {
			return {
				
			};
		},
		computed:{
			...mapState('user',['orderList'])
		},
		async onLoad() {
		  console.log(this.orderList);
		}
	}
</script>

<style lang="scss">
.list{
	padding-bottom: 20px;
}
.title{
	height: 50px;
	background-color: #C00000;
	color: white;
	line-height: 50px;
	text-align: center;
	border-top: 1px solid white;
}
.orderItem{
	border-bottom: 1px solid #8a8a8a;
	.title-container{
		width: 100%;
		padding: 5px 0px;
		font-size: 12px;
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid #d5d5d5;
		.orderNum{
			text{
				padding-left: 5px;
			}
		}
		.orderTime{
			text{
				padding-right: 5px;
			}
		}
	}
	
	.Item-container{
		height: 100px;
		width: 100%;
		display: flex;
		flex-direction: column;
		border-bottom: 1px solid #d5d5d5;
		.top{
			height: 70px;
			width: 100%;
			padding: 5px 0 5px 5px;
			display: flex;
			box-sizing: border-box;
			.orderImage{
				height: 60px;
				width: 60px;
				image{
					height: 60px;
					width: 60px;
				}
			}
			.orderDetail{
				width: 100%;
				height: 60px;
				margin: 0 5px;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;
				.left{
					font-size: 13px;
					margin-right: 5px;
					overflow:hidden;
				}
				.right{
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: flex-start;
				}
			}
		}
	}
	
	.price{
		line-height: 30px;
		width: 100%;
		display: flex;
		justify-content: flex-end;
		text{
			padding-right: 10px;
		}
	}
}
</style>
